<template>
  <div class="box">
    <el-pagination :current-page="pageNum" @current-change="PageChange" @size-change="pageSizeChange"
      :page-sizes="[5, 10, 15]" :page-size="pageSize" layout="total, sizes, prev, pager, next"  background :total="total">
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pageSize:10
    }
  },
  props:{
    total:{
      type:Number,
      default:20
    },
    pageNum:{
      type:Number,
      default:1
    }
  },
  methods: {
    PageChange(val) {
      console.log(val,'页数切换');
      this.$emit('PageChange',val)
    },
    pageSizeChange(val) {
      console.log(val,'每页页数切换');
      this.pageSize = val
      this.$emit('pageSizeChange',val)
    },
  },
}
</script>

<style lang="less" scoped>
.box{
  display: flex;
  justify-content: center;
  margin-top: 40px;
  // position: fixed;
  // bottom: 20px;
  // left:50%;
  // transform: translateX(-50%);
  // padding: 20px;
}
</style>